<?php
Yii::import('zii.widgets.CPortlet');
class NewsPortlet extends CPortlet
{
	public $title='Aktuell:';
	public $newsPerPage='-12';

	public function getLastNews()
	{
		if($this->newsPerPage == -1)
			$this->newsPerPage = Yii::app()->params['newsPerPage'];
		return News::model()->getLastNews(Yii::app()->params['siteId'], $this->newsPerPage);
	}

	protected function renderContent()
	{
		$this->render('newsPortlet');
	}

}